package com.ourteam.system.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Thu Jul 12 16:34:06 CST 2018
 * Auto Generate Date : 2018-07-20 12:04:51
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class SystemRoleGroupRelate implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id", com.ourteam.system.dao.ISysRoleRelateDAO.Id);

        mappedDaoFields.put("relatedSysRoleId",
            com.ourteam.system.dao.ISysRoleRelateDAO.RelatedSysRoleId);

        mappedDaoFields.put("remarks",
            com.ourteam.system.dao.ISysRoleRelateDAO.Remarks);

        mappedDaoFields.put("status",
            com.ourteam.system.dao.ISysRoleRelateDAO.Status);

        mappedDaoFields.put("sysRoleGroupId",
            com.ourteam.system.dao.ISysRoleRelateDAO.SysRoleGroupId);

        mappedDaoFields.put("relatedSysRoleCode",
            com.ourteam.system.dao.ISysRoleRelateDAO.RelatedSysRoleCode);

        mappedDaoFields.put("sysRoleName",
            com.ourteam.system.dao.ISysRoleRelateDAO.SysRoleName);

        mappedDaoFields.put("sysRoleCode",
            com.ourteam.system.dao.ISysRoleRelateDAO.SysRoleCode);

        mappedDaoFields.put("sysRoleType",
            com.ourteam.system.dao.ISysRoleRelateDAO.SysRoleType);

        mappedDaoFields.put("sysDomainCode",
            com.ourteam.system.dao.ISysRoleRelateDAO.SysDomainCode);

        mappedDaoFields.put("sysDomainName",
            com.ourteam.system.dao.ISysRoleRelateDAO.SysDomainName);
    }

    private com.ourteam.system.dao.SysRoleRelate sysRoleRelate;

    public SystemRoleGroupRelate() {
        super();

        this.sysRoleRelate = new com.ourteam.system.dao.SysRoleRelate();
    }

    public SystemRoleGroupRelate(
        com.ourteam.system.dao.SysRoleRelate sysRoleRelate) {
        super();

        this.sysRoleRelate = sysRoleRelate;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(sysRoleRelate);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.system.dao.SysRoleRelate convertToSysRoleRelate() {
        return this.sysRoleRelate;
    }

    public com.ourteam.system.dao.SysRoleRelate convertTo() {
        return this.sysRoleRelate;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.sysRoleRelate.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.sysRoleRelate.setId(id);
    }

    /**
     * Get relatedSysRoleId
     *
     * @return long
     */
    public long getRelatedSysRoleId() {
        return (long) this.sysRoleRelate.getRelatedSysRoleId();
    }

    /**
     * Set relatedSysRoleId
     *
     * @parameter long
     */
    public void setRelatedSysRoleId(long relatedSysRoleId) {
        this.sysRoleRelate.setRelatedSysRoleId(relatedSysRoleId);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.sysRoleRelate.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.sysRoleRelate.setRemarks(remarks);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.sysRoleRelate.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.sysRoleRelate.setStatus(status);
    }

    /**
     * Get sysRoleGroupId
     *
     * @return long
     */
    public long getSysRoleGroupId() {
        return (long) this.sysRoleRelate.getSysRoleGroupId();
    }

    /**
     * Set sysRoleGroupId
     *
     * @parameter long
     */
    public void setSysRoleGroupId(long sysRoleGroupId) {
        this.sysRoleRelate.setSysRoleGroupId(sysRoleGroupId);
    }

    /**
     * Get relatedSysRoleCode
     *
     * @return String
     */
    public String getRelatedSysRoleCode() {
        return (String) this.sysRoleRelate.getRelatedSysRoleCode();
    }

    /**
     * Set relatedSysRoleCode
     *
     * @parameter String
     */
    public void setRelatedSysRoleCode(String relatedSysRoleCode) {
        this.sysRoleRelate.setRelatedSysRoleCode(relatedSysRoleCode);
    }

    /**
     * Get sysRoleName
     *
     * @return String
     */
    public String getSysRoleName() {
        return (String) this.sysRoleRelate.getSysRoleName();
    }

    /**
     * Get sysRoleCode
     *
     * @return String
     */
    public String getSysRoleCode() {
        return (String) this.sysRoleRelate.getSysRoleCode();
    }

    /**
     * Get sysRoleType
     *
     * @return String
     */
    public String getSysRoleType() {
        return (String) this.sysRoleRelate.getSysRoleType();
    }

    /**
     * Get sysDomainCode
     *
     * @return String
     */
    public String getSysDomainCode() {
        return (String) this.sysRoleRelate.getSysDomainCode();
    }

    /**
     * Get sysDomainName
     *
     * @return String
     */
    public String getSysDomainName() {
        return (String) this.sysRoleRelate.getSysDomainName();
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof SystemRoleGroupRelate) == false) {
            return false;
        } // end if

        SystemRoleGroupRelate other = (SystemRoleGroupRelate) obj;

        boolean isEqual = false;

        com.ourteam.system.dao.SysRoleRelate tempSysRoleRelate = other.convertToSysRoleRelate();

        if ((tempSysRoleRelate == null) || (this.sysRoleRelate == null)) {
            isEqual = false;
        } else if ((tempSysRoleRelate == this.sysRoleRelate) ||
                tempSysRoleRelate.equals(this.sysRoleRelate)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static SystemRoleGroupRelate[] toArray(
        com.ourteam.system.dao.SysRoleRelate[] aSysRoleRelates) {
        return toArray(aSysRoleRelates, null);
    }

    public static SystemRoleGroupRelate[] toArray(
        com.ourteam.system.dao.SysRoleRelate[] aSysRoleRelates,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aSysRoleRelates)) {
            return new SystemRoleGroupRelate[0];
        }

        int length = aSysRoleRelates.length;

        SystemRoleGroupRelate[] beans = new SystemRoleGroupRelate[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new SystemRoleGroupRelate(aSysRoleRelates[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i], new Object[] { aSysRoleRelates[i] });
            }
        }

        return beans;
    }
}
